package com.erp.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.erp.dto.Reply;

@SuppressWarnings("serial")
@Entity
@Table(name = "t_reply")
public class TReply extends TArticle implements java.io.Serializable {

	private Integer floor;// 楼层
	private TTopic tTopic;// 所属的主题

	public TReply() {
	}

	/**
	 * tTopic逻辑层手动设置
	 * 
	 * @param reply
	 */
	public TReply(Reply reply) {
		super(reply);
		this.floor = reply.getFloor();
	}

	@Column(name = "floor")
	public Integer getFloor() {
		return floor;
	}

	public void setFloor(Integer floor) {
		this.floor = floor;
	}

	/**
	 * tTopic为映射属性，本类与TTopic是多对一双向关系
	 * 
	 * @return
	 */
	@ManyToOne
	@JoinColumn(name = "topic_id")
	public TTopic gettTopic() {
		return tTopic;
	}

	public void settTopic(TTopic tTopic) {
		this.tTopic = tTopic;
	}

}
